package com.zhieasy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhieasy.domain.StudentInfoVo;
import com.zhieasy.domain.StudentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhieasy.domain.Student;
import com.zhieasy.mapper.StudentMapper;
import com.zhieasy.service.StudentService;

/**
 * @author 风亦未止
 * @date 2021/11/16 19:44
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public PageInfo<StudentVo> getList(int pageNum, int pageSize, Student student) {
        return PageHelper.startPage(pageNum,pageSize).doSelectPageInfo(()->{
            studentMapper.selectAll(student);
        });
    }

    @Override
    public List<StudentVo> getAll(Student student) {
        return studentMapper.selectAll(student);
    }

    @Override
    public Integer getStudentNum() {
        return studentMapper.getStudentNum();
    }

    @Override
    public Integer getSubmitNum() {
        return studentMapper.getSubmitNum();
    }

    @Override
    public StudentInfoVo getInfo(Student student) {
        return studentMapper.getInfo(student);
    }
}

